package com.ruoyi.wb.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.wb.mapper.WbAgreementsMapper;
import com.ruoyi.wb.domain.WbAgreements;
import com.ruoyi.wb.service.IWbAgreementsService;

/**
 * 协议Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-10-14
 */
@Service
public class WbAgreementsServiceImpl implements IWbAgreementsService 
{
    @Autowired
    private WbAgreementsMapper wbAgreementsMapper;

    /**
     * 查询协议
     * 
     * @param id 协议主键
     * @return 协议
     */
    @Override
    public WbAgreements selectWbAgreementsById(Long id)
    {
        return wbAgreementsMapper.selectWbAgreementsById(id);
    }

    /**
     * 查询协议列表
     * 
     * @param wbAgreements 协议
     * @return 协议
     */
    @Override
    public List<WbAgreements> selectWbAgreementsList(WbAgreements wbAgreements)
    {
        return wbAgreementsMapper.selectWbAgreementsList(wbAgreements);
    }

    /**
     * 新增协议
     * 
     * @param wbAgreements 协议
     * @return 结果
     */
    @Override
    public int insertWbAgreements(WbAgreements wbAgreements)
    {
        wbAgreements.setCreateTime(DateUtils.getNowDate());
        return wbAgreementsMapper.insertWbAgreements(wbAgreements);
    }

    /**
     * 修改协议
     * 
     * @param wbAgreements 协议
     * @return 结果
     */
    @Override
    public int updateWbAgreements(WbAgreements wbAgreements)
    {
        wbAgreements.setUpdateTime(DateUtils.getNowDate());
        return wbAgreementsMapper.updateWbAgreements(wbAgreements);
    }

    /**
     * 批量删除协议
     * 
     * @param ids 需要删除的协议主键
     * @return 结果
     */
    @Override
    public int deleteWbAgreementsByIds(Long[] ids)
    {
        return wbAgreementsMapper.deleteWbAgreementsByIds(ids);
    }

    /**
     * 删除协议信息
     * 
     * @param id 协议主键
     * @return 结果
     */
    @Override
    public int deleteWbAgreementsById(Long id)
    {
        return wbAgreementsMapper.deleteWbAgreementsById(id);
    }
}
